package com.example.admin.yuejian21.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.example.admin.yuejian21.R;
import com.example.admin.yuejian21.Service.Service;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static com.example.admin.yuejian21.activity.LoginActivity.sessionid;

public class SetActivity extends AppCompatActivity {
    private Button logout;
    private Button thinkbutton;
    private Button infoButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_set);
        logout = (Button) findViewById(R.id.button7_logout);
        thinkbutton= (Button) findViewById(R.id.Button_yj);
        infoButton= (Button) findViewById(R.id.button3_stinfo);
        logout.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
         /* Retrofit retrofit = new Retrofit.Builder().baseUrl("http://139.129.208.64/api.php/").addConverterFactory(GsonConverterFactory.create())
                  .build();
          Service service=retrofit.create(Service.class);
          Call<Object> call=service.logout(sessionid);
          call.enqueue(new Callback<Object>() {
              @Override
              public void onResponse(Call<Object> call, Response<Object> response) {
                  if (response.body() == null) {
                      Toast.makeText(SetActivity.this, "已注销", Toast.LENGTH_SHORT).show();*/
                      Intent intent=new Intent(SetActivity.this,LoginActivity.class);
                      startActivity(intent);

                  /*}
              }
              public void onFailure(Call<Object> call, Throwable t) {

              }
          });*/


      }
  });
thinkbutton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Intent intent=new Intent(SetActivity.this,yjActivity.class);
        startActivity(intent);

    }
});
        infoButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(SetActivity.this,infoActivity.class);
                startActivity(intent);
            }
        });
    }
}
